package cn.lanqiao.service.impl;

import cn.lanqiao.entity.UserLogin;
import cn.lanqiao.service.UserLoginService;

public class UserLoginServiceImpl implements UserLoginService {
	cn.lanqiao.dao.UserLoginDao dao = new cn.lanqiao.dao.impl.UserLoginDaoImpl();
	@Override
	public UserLogin login(String uaccount, String upassword) {
		UserLogin uuser = dao.getUser(uaccount);
		if(uuser!=null) {
			if(uuser.getPassword().equals(upassword)) {
				return uuser;
			}
		}
		return null;
	}
	@Override
	public int check(String uaccount,String upassword) {
		UserLogin uuser = dao.getUser(uaccount);
		if(uuser!=null) {
			if(uuser.getPassword().equals(upassword))
				return dao.deleteUser(uaccount);
		}
		return 0;
	}

}
